<template>
  <div>
    <table class="tb">
      <tr>
        <th>编号</th>
        <th>品牌名称</th>
        <th>创立时间</th>
        <th>操作</th>
      </tr>
      <tr v-for="(item) in arr" :key="item.id">
        <td>{{item.code}}</td>
        <td>{{item.productName}}</td>
        <td>{{item.timer}}</td>
        <td><button @click="del(item.id)">删除</button></td>
      </tr>
    


    </table>
      <div class="lastdv" v-show="!arr.length">没有更多数据</div>
  </div>
</template>


<script>
    export default{
        props:{
            arr:{
                type: Array,
                require: true
            }
        },
        methods:{
            del(i){
                this.$emit('del',i)
            }
        }
    }

</script>





<style>
#app {
  width: 600px;
  margin: 10px auto;
}

.tb {
  border-collapse: collapse;
  width: 100%;
}

.tb th {
  background-color: #0094ff;
  color: white;
}

.tb td,
.tb th {
  padding: 5px;
  border: 1px solid black;
  text-align: center;
}

.add {
  padding: 5px;
  border: 1px solid black;
  margin-bottom: 10px;
}
.lastdv{
    width: 100%;
    text-align: center;
}
</style>